 

  <script type="text/javascript">
	$(document).ready(function () {
  
  
     //Click category

    $("#category_filter").live("click", function(){
    
      $("#pn-maincontent").empty().html("<img class='loader' src='modules/InnoForum/pnimages/loading_2.gif'/>"); 
      $.ajax({
          type: "get",
          url:  "index.php",
          data: "module=InnoForum&type=ajax&func=list&ctrl=Topics&category_id="+$(this).attr('data'),
          success: function(response) {
              //alert(response);
              $("#pn-maincontent").html("");
              $("#pn-maincontent").empty().html(response);
          }
      });//End post function
      
     });//End category click function
   

   
    //Click subcategory
    $("#subcategory_filter").live("click",  function(){
     

      //Get data
      $("#pn-maincontent").empty().html("<img class='loader' src='modules/InnoForum/pnimages/loading_2.gif'/>"); 
      $.ajax({
          type: "get",
          url:  "index.php",
          data: "module=InnoForum&type=ajax&func=list&ctrl=Topics&subcategory_id="+$(this).attr('data'),
          success: function(response) {
              //alert(response);
              $("#pn-maincontent").html("");
              $("#pn-maincontent").empty().html(response);
          }
      });//End post function 
    });//End subcategory click function

  });//End main function
    
    
  </script>
    <div id="category_list">
    <!--[foreach from=$categorySubcategoryArray item=itemCategory]-->
      <span id="category_filter" data="<!--[$itemCategory.category_id]-->" >       
        <!--[$itemCategory.category_name]-->
      </span>
      <br>  
      <!-- Display subcategory -->       
      <!--[foreach from=$itemCategory.subcategory item=itemSubcategory]-->  
        &nbsp; &nbsp; &nbsp; 
          &nbsp;
        <span id="subcategory_filter" data="<!--[$itemSubcategory.subcategory_id]-->" >          
          <!--[$itemSubcategory.subcategory_name]-->
        </span>
        <br>      
      <!--[/foreach]--><!-- ####### End Subcategory Loop ###### -->         
      <br>    
    <!--[/foreach]--><!-- ###### End Category Loop ###### -->
    </div>  